//-------------------------------------------------------------------------
//   Copyright 2002-2023 National Technology & Engineering Solutions of
//   Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
//   NTESS, the U.S. Government retains certain rights in this software.
//
//   This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
//   Xyce(TM) is free software: you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   Xyce(TM) is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with Xyce(TM).
//   If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
//
// Purpose        : Utilities related to handling wildcard syntaxes on
//                  .PRINT lines.  These functions are mostly wrappers to
//                  the regex libraries supported by C++ 11.  At present
//                  only the star (*) character is supported for .PRINT.
// Special Notes  :
// Creator        : Pete Sholander, SNL
// Creation Date  : 2019/10/01
//
//-------------------------------------------------------------------------

#ifndef Xyce_N_IO_WildcardSupport_h
#define Xyce_N_IO_WildcardSupport_h

#include <regex>

#include <N_IO_fwd.h>

namespace Xyce {
namespace IO {

std::regex makeRegexFromString(const std::string &str);

void replaceAll(std::string& str, const char charToFind, const std::string& repStr);

bool findWildCardMatch(
  const std::string &name,
  const unordered_set<std::string> &node_set);

bool findAllWildCardMatches(
  const std::string &name,
  const unordered_set<std::string> &node_set,
  std::vector<std::string> &matches);

} // namespace IO
} // namespace Xyce

#endif // Xyce_N_IO_WildcardSupport_h
